import 'package:wanxiang_app/generated/json/base/json_convert_content.dart';
import 'package:wanxiang_app/bean/kan_count_entity.dart';

KanCountEntity $KanCountEntityFromJson(Map<String, dynamic> json) {
  final KanCountEntity kanCountEntity = KanCountEntity();
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    kanCountEntity.code = code;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    kanCountEntity.msg = msg;
  }
  final String? buyNum = jsonConvert.convert<String>(json['buy_num']);
  if (buyNum != null) {
    kanCountEntity.buyNum = buyNum;
  }
  final String? myNum = jsonConvert.convert<String>(json['my_num']);
  if (myNum != null) {
    kanCountEntity.myNum = myNum;
  }
  return kanCountEntity;
}

Map<String, dynamic> $KanCountEntityToJson(KanCountEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['msg'] = entity.msg;
  data['buy_num'] = entity.buyNum;
  data['my_num'] = entity.myNum;
  return data;
}

extension KanCountEntityExtension on KanCountEntity {
  KanCountEntity copyWith({
    int? code,
    String? msg,
    String? buyNum,
    String? myNum,
  }) {
    return KanCountEntity()
      ..code = code ?? this.code
      ..msg = msg ?? this.msg
      ..buyNum = buyNum ?? this.buyNum
      ..myNum = myNum ?? this.myNum;
  }
}